<!-- 设备保养-保养计划-清单模板 -->
<template>
  <div style="width: 100%; height: 100%; margin: 0">
    <iframe id="PMS_IFRAME_RULES" width="100%" height="100%" name="ALL_EQUIP_EPM_PLAN_RULES" frameborder="0" :src="url" @load="onLoad" />
  </div>
</template>

<script setup lang="ts">
import { getToken } from "@/utils/auth";
// defineOptions({
//   name: "ALL_EQUIP_EPM_PLAN_RULES"
// });
const accessToken = getToken().accessToken || "";

const permission = localStorage.getItem("pmsPermission");

const onLoad = () => {
  const iframeRules = document.getElementById("PMS_IFRAME_RULES") as HTMLIFrameElement;
  iframeRules?.contentWindow?.postMessage(JSON.parse(permission), "*");
};
const facCode = localStorage.getItem("facCode");

const url = `${import.meta.env.VITE_API_URL_PMS_NEW}/#/pmPlan/checklist?ssoToken=${accessToken}&isHiddenMenu=true&facCode=${facCode}`;
</script>
